<!DOCTYPE html>
<html lang="en">
<head>
    <include file="Common/top"/>
    <include file="Common/import_plugin"/>
    <style>
        .layui-table tr td {
            font-size: 12px;
        }
    </style>
</head>
<body>
<include file="Common/nav_menu"/>
<table class="layui-table">
    <tr>
        <td>ID</td>
        <td>退单号</td>
        <td>订单号</td>
        <td>用户ID</td>
        <td>订单ID</td>
        <td>商品模型</td>
        <td>数量</td>
        <td>信息</td>
        <td>提交时间</td>
        <td>处理时间</td>
        <td>处理状态</td>
        <td>通过/驳回</td>
        <td>操作</td>
    </tr>
    <volist name='list' id="vo">
        <tr>
            <td>{$vo.id}</td>
            <td>{$vo.return_order_code}</td>
            <td>{$vo.order_code}</td>
            <td>{$vo.user_id}</td>
            <td>{$vo.order_id}</td>
            <td>{$vo.goods_model}</td>
            <td>{$vo.num}</td>
            <td>{$vo.message}</td>
            <td>{:date('Y-m-d H:i:s',$vo['addtime'])}</td>
            <td>
                <if condition="$vo['overtime']">
                    <font color="red">{:date('Y-m-d H:i:s',$vo['overtime'])}</font>
                    <else/>
                    <font color="blue">未处理</font>
                </if>
            </td>
            <td>{:getStatus($vo['status'])}</td>
            <td>
                <switch name="vo['is_success']">
                    <case value="0">
                        <font color="blue">待处理</font>
                    </case>
                    <case value="1">
                        <font color="green">通过</font>
                    </case>
                    <case value="-1">
                        <font color="red">驳回</font>
                    </case>
                </switch>
            <td>
                <if condition="$vo['status'] eq 1 && $vo['is_success'] eq -1">
                    <span class="back_message layui-btn layui-btn-normal layui-btn-xs"
                          data-message="{$vo.return_message}">原因</span>
                    <else/>
                    <a class="layui-btn layui-btn-normal layui-btn-xs"
                       href="{:U('accept_piaofutong_return',array('id'=>$vo['id']))}">接口受理</a>
                    <if condition="$vo['status'] eq 0">
                        <a class="layui-btn layui-btn-xs"
                           href="{:U('accept_piaofutong_return',array('id'=>$vo['id']))}">通过</a>
                        <else/>
                        <a class="layui-btn layui-btn-xs" href="{:U('act_accept',array('id'=>$vo['id']))}">通过</a>
                    </if>
                    <a class="layui-btn layui-btn-danger layui-btn-xs"
                       href="{:U('backOrderReturn',array('id'=>$vo['id']))}">驳回</a>
                </if>
                <button class="r_msg layui-btn layui-btn-warm layui-btn-xs" data-info="{$vo['return_message']}">信息
                </button>
            </td>
        </tr>
    </volist>
</table>
<div class="page">
    {$page}
</div>
<script>
    layui.use('layer', function () {
        $('.back_message').click(function () {
            var self = $(this);
            layer.open({
                id: 'layerReturnMessage'
                , content: self.attr('data-message')
                , btnAlign: 'c'
                , shade: .3
            });
        });
        $('.r_msg').click(function () {
            var self = $(this);
            let content = '没有信息';
            if (self.attr('data-info'))
                content = self.attr('data-info');
            layer.open({
                id: 'layerReturnMessage'
                , content: content
                , btnAlign: 'c'
                , shade: .3
            });
        })
    })
</script>
</body>
</html>